//初始化数据库
const db = wx.cloud.database()
const step = db.collection('HH_Step')

Page({
  data: {
    numList: [{
      name: '开始'
    }, {
      name: '填表'
    }, {
      name: '交钱'
    }, {
      name: '去宿舍'
    }, {
      name: '完成'
    }, ],
    num: 0,
    step: []
  },
  //绑定swiper指哪跳哪
  numSteps() {
    this.setData({
      num: this.data.num == this.data.numList.length - 1 ? 0 : this.data.num + 1
    })
  },
  //绑定页面点哪跳哪
  numStepsPro(e) {
    this.setData({
      num: e.target.dataset.index - 1
    })
  },
  //禁止页面滑动
  stopTouchMove: function () {
    return false;
  },
  //加载页面中细化的步骤
  onLoad: function (e) {
    step.get().then(res => {
      this.setData({
        step: res.data
      })
    })
  }
})